<?php

namespace App\Libs;

class SmsCode
{
  public static function check($mobile, $sms)
  {
    $cached = \Cache::pull($mobile);
    if (!$cached) {
      fail('验证码已过期');
    }
    if ($cached != $sms) {
      fail('验证码错误');
    }
  }
}
